﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DesignPattern.FactoryPattern
{
    public partial class FormOperation : Form
    {
        public FormOperation()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OperationFactory oprf = new OperationFactory();
            Operation opr = oprf.CreateOperation(comboBox1.Text);
            opr.NumA = double.Parse(textBox1.Text);
            opr.NumB = double.Parse(textBox2.Text);
            textBox3.Text = opr.GetResult().ToString();
        }
    }
}
